/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.aaron.platform.entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 *
 * @author mac
 */
@Entity
@Table(name = "fgys_enterprise_info")
@SequenceGenerator(name="fgys_enterprise_generator", sequenceName="fgys_enterprise_generator", allocationSize = 1)
@NamedQueries({
    @NamedQuery(name = "FgysEnterprise.findAll", query = "SELECT f FROM FgysEnterprise f")})
public class FgysEnterprise implements Serializable {

    private static final long serialVersionUID = 1L;
    
    public static final String ENTERPRISE_NAME = "enterpriseName"; 

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO, generator="fgys_enterprise_generator")
    @Column(name = "enterprise_id")
    private Integer enterpriseId;

    /** 单位名称 */
    @Column(name = "enterprise_name")
    private String enterpriseName;

    /** 单位地址 */
    @Column(name = "enterprise_address")
    private String enterpriseAddress;

    /** 单位联系人 */
    @Column(name = "enterprise_contactor")
    private String enterpriseContactor;

    /** 联系电话 */
    @Column(name = "enterprise_contactor_phone")
    private String enterprisePhone;

    /** 联系邮箱 */
    @Column(name = "enterprise_contactor_email")
    private String enterpriseEmail;

    /** 单位账户 */
    @Column(name = "account_name")
    private String accountName;

    /** 开户银行 */
    @Column(name = "account_bank")
    private String accountBank;

    /** 银行账户 */
    @Column(name = "account_no")
    private String accountNo;

    /** 单位负责的逻辑站点列表 */
    @OneToMany(mappedBy = "enterpriseInfo", fetch = FetchType.LAZY)
    private List<FgysLogicalSite> fgysLogicalSiteList;

    /** 单位与我方签订的合同列表 */
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "enterpriseInfo", fetch = FetchType.LAZY)
    private List<FgysContract> fgysContractList;

    public FgysEnterprise() {
    }

    public FgysEnterprise(Integer enterpriseId) {
        this.enterpriseId = enterpriseId;
    }

    public Integer getEnterpriseId() {
        return enterpriseId;
    }

    public void setEnterpriseId(Integer enterpriseId) {
        this.enterpriseId = enterpriseId;
    }

    public String getEnterpriseName() {
        return enterpriseName;
    }

    public void setEnterpriseName(String enterpriseName) {
        this.enterpriseName = enterpriseName;
    }

    public String getEnterpriseAddress() {
        return enterpriseAddress;
    }

    public void setEnterpriseAddress(String enterpriseAddress) {
        this.enterpriseAddress = enterpriseAddress;
    }

    public String getEnterpriseContactor() {
        return enterpriseContactor;
    }

    public void setEnterpriseContactor(String enterpriseContactor) {
        this.enterpriseContactor = enterpriseContactor;
    }

    public String getEnterprisePhone() {
        return enterprisePhone;
    }

    public void setEnterprisePhone(String enterprisePhone) {
        this.enterprisePhone = enterprisePhone;
    }

    public String getAccountName() {
        return accountName;
    }

    public void setAccountName(String accountName) {
        this.accountName = accountName;
    }

    public String getAccountBank() {
        return accountBank;
    }

    public void setAccountBank(String accountBank) {
        this.accountBank = accountBank;
    }

    public String getAccountNo() {
        return accountNo;
    }

    public void setAccountNo(String accountNo) {
        this.accountNo = accountNo;
    }

    public String getEnterpriseEmail() {
        return enterpriseEmail;
    }

    public void setEnterpriseEmail(String enterpriseEmail) {
        this.enterpriseEmail = enterpriseEmail;
    }

    public List<FgysLogicalSite> getFgysLogicalSiteList() {
        return fgysLogicalSiteList;
    }

    public void setFgysLogicalSiteList(List<FgysLogicalSite> fgysLogicalSiteList) {
        this.fgysLogicalSiteList = fgysLogicalSiteList;
    }

    public List<FgysContract> getFgysContractList() {
        return fgysContractList;
    }

    public void setFgysContractList(List<FgysContract> fgysContractList) {
        this.fgysContractList = fgysContractList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (enterpriseId != null ? enterpriseId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FgysEnterprise)) {
            return false;
        }
        FgysEnterprise other = (FgysEnterprise) object;
        if ((this.enterpriseId == null && other.enterpriseId != null) || (this.enterpriseId != null && !this.enterpriseId.equals(other.enterpriseId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.aaron.platform.entity.FgysEnterprise[enterpriseId=" + enterpriseId + "]";
    }
}
